package com.luke.springcloud.feign;

import com.luke.springcloud.entities.UserInfo;
import com.luke.springcloud.feign.hystrix.ProviderFeignClientHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Descrtption Feign客户端
 * @Author luke
 * @Date 2020/5/12
 **/
//@FeignClient(name = "cloud-feign-provider",configuration = MyFeignConfig.class)
@FeignClient(name = "cloud-feign-provider",fallback = ProviderFeignClientHystrix.class)
public interface ProviderFeignClient {

    @GetMapping("/provider/echo/{id}")
    UserInfo echo(@PathVariable("id") Long id);

    /**@SpringQueryMap 让GET请求参数也可以是对象类型*/
    @GetMapping("/provider/query")
    UserInfo queryUserInfo(@SpringQueryMap UserInfo userInfo);

}
